import { Space, Table, Tag } from 'antd';
import React, { useState,useEffect } from 'react';
import axios from "../../utils/axios"

const App = () => {
    let [arr,setArr] = useState([])
    let [colums,setColums] = useState([
      {
        title: 'Name',
        dataIndex: 'name',
        key: 'name',
        render: (text) => <a>{text}</a>,
      },
      {
        title: 'sex',
        dataIndex: 'sex',
        key: 'sex',
      },
      {
        title: 'Address',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: '操作',
        key: 'action',
        render: (_, record) => (
          <Space size="middle">
            <a>Invite {record.name}</a>
            <a>Delete</a>
          </Space>
        ),
      },
    ]

    )
    useEffect(()=>{
      axios.get("/api/tablelist").then(res=>{
        setArr(res.data)
      })
    },[])

    return  <Table columns={colums} dataSource={arr} />

};
export default App;